package com.episode.duetapi.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.episode.duetapi.mapper.BannerMapper;
import com.episode.duetapi.model.Banner;
import com.episode.duetapi.service.BannerService;

@Service
public class BannerServiceImpl implements BannerService{
	
	@Autowired
	private BannerMapper bannerMapper;

	@Override
	public Integer insertBanner(Banner banner) {
		Integer i = bannerMapper.insert(banner);
		return null == i?0:i;
	}

	@Override
	public List<Banner> getBannerList(Map<String, Object> paramMap) {
		
		return bannerMapper.getBannerList(paramMap);
	}

	@Override
	public Banner getBannerById(Integer id) {
		
		return bannerMapper.selectByPrimaryKey(id);
	}

	@Override
	public Integer updateBanner(Banner banner) {
		Integer i = bannerMapper.updateByPrimaryKey(banner);
		return null == i?0:i;
	}

	@Override
	public Integer deleteBanner(Integer id) {
		Integer i = bannerMapper.deleteByPrimaryKey(id);
		return null == i?0:i;
	}

	@Override
	public Integer updateBannerStatus(Map paramMap) {
		Integer i = bannerMapper.updateBannerStatus(paramMap);
		return null == i?0:i;
	}
	
}
